package org.nicocube.airain.domain.client.gamedate;

import org.nicocube.airain.domain.client.data.Storable;

public class GameDateManager implements Storable {

	private BirthDate beginning;
	private GameDate last;
	private GameDate current;
	
	public GameDateManager(BirthDate beginning) {
		this.beginning = beginning;
		IncrementalGameDate last = new IncrementalGameDate(beginning).incHour(-1);
		this.last = new GameDate(last);
		this.current = new GameDate(beginning);
	}
	
	public BirthDate getBeginning() {
		return beginning;
	}
	public GameDate getLast() {
		return last;
	}
	public GameDate getCurrent() {
		return current;
	}
	public GameDate getNext() {
		return new GameDate(current.getHours()+1,current.getMoonDays(),current.getYearMoons(),current.getYears());
	}
	public void incCurrent() {
		last=current;
		current=getNext();
	}
}
